import  React from "react"
import PropTypes from "prop-types"
import "../../assets/css/base/Header.scss"

class Header extends  React.Component{
    constructor(props){
        super(props);
        this.isLeft=this.isLeft.bind(this);
        this.isRight=this.isRight.bind(this);
    }
    isLeft(){
        if(this.props.isLeft){
            return  <p  className="header-tips header-left" onClick={this.props.headerLeftGo}>{this.props.leftText}</p>
        }
        return null;
    }
    isRight(){
        if(this.props.isRight){
            return   <p className="header-tips header-right"  onClick={this.props.headerRightGo}>{this.props.rightText}</p>
        }
        return null;
    }
    render() {
        return (

            <header className="header-top">
                <h1 className="header-title">{this.props.headerText}</h1>
                {this.isLeft()}
                {this.isRight()}
            </header>

        )
    }

}

export default Header
